package com.zys.service.impl;

import java.util.Date;
import java.util.List;

import com.zys.dao.CateDao;
import com.zys.pojo.Category;
import com.zys.service.CateService;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class CateServiceImpl implements CateService {
  @Autowired
  private CateDao cateDao;

  @Override
  public List<Category> findAll() {
    return cateDao.findAll();
  }

  @Override
  public void add(Category category) {
    category.setCreateTime(new Date().getTime());
    cateDao.add(category);
  }

  @Override
  public Category findCateById(Integer id) {
    return cateDao.findCateById(id);
  }

  @Override
  public void delete(Integer id) {
    cateDao.delete(id);
  }

  @Override
  public void edit(Category category) {
    cateDao.edit(category);
  }
}
